package org.akomantoso.core.io;

import java.io.IOException;
import java.io.InputStream;
import java.util.Map;

import org.akomantoso.core.data.AkomaNtoso;
import org.akomantoso.core.data.AnyOtherTypeElement;
import org.akomantoso.core.io.impl.InputFactoryImpl;
import org.akomantoso.core.io.util.Instantiator;

/**
 * @author <a href="mailto:jacques.militello@gmail.com">Jacques Militello</a>
 */
public abstract class InputFactory {
	
	public InputFactory(){}
	
	public static InputFactory newFactory() {
		return new InputFactoryImpl();
	}
	
	public abstract AkomaNtoso read(InputStream stream,String encoding) throws IOException;
	
	public abstract void addTag(String namespaceURI, String tagName, Instantiator<AnyOtherTypeElement> instantiator);

	public abstract Map<String, Instantiator<AnyOtherTypeElement>> getMap(String namespaceURI);

}